import request from '@/utils/request'

// 查询设备采集配置列表
export function listCollect(query) {
  return request({
    url: '/device/collect/list',
    method: 'get',
    params: query
  })
}

// 查询设备采集配置详细
export function getCollect(configId) {
  return request({
    url: '/device/collect/' + configId,
    method: 'get'
  })
}

// 新增设备采集配置
export function addCollect(data) {
  return request({
    url: '/device/collect',
    method: 'post',
    data: data
  })
}

// 修改设备采集配置
export function updateCollect(data) {
  return request({
    url: '/device/collect',
    method: 'put',
    data: data
  })
}

// 删除设备采集配置
export function delCollect(configId) {
  return request({
    url: '/device/collect/' + configId,
    method: 'delete'
  })
}

// 启动采集任务
export function startCollect(configId) {
  return request({
    url: '/device/collect/start/' + configId,
    method: 'post'
  })
}

// 停止采集任务
export function stopCollect(configId) {
  return request({
    url: '/device/collect/stop/' + configId,
    method: 'post'
  })
}

// 手动执行采集
export function executeCollect(configId) {
  return request({
    url: '/device/collect/execute/' + configId,
    method: 'post'
  })
}

